<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Example</title>
</head>

<body>
  <script>
  document.writeln("<pre>");
  document.writeln("protocal: " + document.location.protocal);
  document.writeln("host: " + document.location.host);
  document.writeln("hostname: " + document.location.hostname);
  document.writeln("port: " + document.location.port);
  document.writeln("pathname: " + document.location.pathname);
  document.writeln("search: " + document.location.search);
  document.writeln("hash: " + document.location.hash);
  document.writeln("</pre>");
  </script>
</body>

</html>
